#include "pollServer.hpp"
#include "Util.hpp"
#include <memory>
#include <cstring>

using namespace poll_ns;

std::string transaction(const std::string& request)
{
    return request;
}


inline void Usage(std::string proc)
{
    std::cout << "Usage : \n\t" << proc << " local_port\n\n";
}

int main(int argc, char* argv[])
{

    if (argc != 2)
    {
        Usage(argv[0]);
        exit(USAGE_ERROR);
    }

    std::unique_ptr<PollServer> server(new PollServer(transaction, atoi(argv[1])));
    
    server->initServer();
    server->start();

    return 0;
}